xen.git
16 years agoxend: pass-through: Extend multi-function mapping
Keir Fraser [Wed, 5 Aug 2009 11:03:53 +0000 (12:03 +0100)]
xend: pass-through: Extend multi-function mapping

This extends the mapping between physical and virtual PCI functions
for multi-function pass-through in two ways. If neither of these
rules apply the existing identity-mapping of physical to virtual
functions is used.

1) If physical function zero is not present in a multi-function
   pass-through device then the numerically lowest physical function
   whose virtual function hasn't explicitly been set will be mapped
   to virtual function 0.

   This is to satisfy the requirement that a (virtual) device
   must always have function 0 present.

2) The virtual function to be used for a physical function may
   be explicitly set.

   e.g. 00:1d.2=3D0,1=3D1,0=3D2@7 will result in the following
   mapping:

        physical | virtual
        ---------+--------
        00:1d.2  | 00:07.0
        00:1d.1  | 00:07.1
        00:1d.0  | 00:07.2

   Ranges may also be used with explicit assignment.
   The following would result in the same mapping as above:

       00:1d.2=3D0-0=3D2@7

Please be aware that it is very likely that using these extensions
it is possible to create mappings that do not work. If in doubt
please use identity-mapping.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoxend: passthrough: add checking when a device is hotplugged into pv guest.
Keir Fraser [Wed, 5 Aug 2009 11:03:08 +0000 (12:03 +0100)]
xend: passthrough: add checking when a device is hotplugged into pv guest.

When we 'xm pci-attach' device into pv guest, we also need to check if
the device is owned by pciback or pci-stub, if the device has been
assigned, etc.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoAdd a single trigger for all diagnostic keyhandlers
Keir Fraser [Sun, 2 Aug 2009 12:43:15 +0000 (13:43 +0100)]
Add a single trigger for all diagnostic keyhandlers

Add a new keyhandler that triggers all the side-effect-free
keyhandlers.  This lets automated tests (and users) log the full set
of keyhandlers without having to be aware of which ones might reboot
the host.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoMake ACPI Cx keyhandler always print something
Keir Fraser [Sun, 2 Aug 2009 11:29:25 +0000 (12:29 +0100)]
Make ACPI Cx keyhandler always print something

...so that from a serial log you can tell the difference between not
pressing the key and not having anything interestying to print.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
16 years agoxend: pci: Use PCIe FLR for VF of Intel 82599 10GbE Controller
Keir Fraser [Sun, 2 Aug 2009 11:28:22 +0000 (12:28 +0100)]
xend: pci: Use PCIe FLR for VF of Intel 82599 10GbE Controller

We know it does have PCIe FLR capability even if it doesn't report
that.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoxend: passthrough: loosen the pci co-assignment for pv guest
Keir Fraser [Sun, 2 Aug 2009 11:27:51 +0000 (12:27 +0100)]
xend: passthrough: loosen the pci co-assignment for pv guest

In current xend, we can not assign co-assignment devices to different
guests, even for pv guests. This patch loosens the policy for pv
guest: if none of the co-assignment devices have been assigned to hvm
guest, we can assign the devices to different pv guests.

The patch also adds a detection: if a device has been assigned to
guest, we can't try to "xm pci-attach" it to the same guest again.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoxend: save/restore cpu_weight and cpu_cap
Keir Fraser [Sun, 2 Aug 2009 11:26:23 +0000 (12:26 +0100)]
xend: save/restore cpu_weight and cpu_cap

This patch allows vcpus_params cpu_weight and cpu_cap to be saved and
restored.  Most the code to support this already existed, but the save
path needed to be updated to explicitly save these params, and the
restore path needed to be updated to resend the params down to the
kernel.

From: Andrew Jones <drjones@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoCompile the kernel by default with bridge support
Keir Fraser [Sun, 2 Aug 2009 11:25:01 +0000 (12:25 +0100)]
Compile the kernel by default with bridge support

This one-liner adds bridge support to the Linux kernel
(CONFIG_BRIDGE=y).  It is a precondition for some xm-tests that
bridge is enabled.  Also IMHO it makes sense to configure a dom0 with
bridge capabilities.

Signed-off-by: Andreas Florath <xen@flonatel.org>
16 years agoxm-test: ramdisk fs type is changed to ext3 if needed
Keir Fraser [Sun, 2 Aug 2009 11:23:46 +0000 (12:23 +0100)]
xm-test: ramdisk fs type is changed to ext3 if needed

This (one line) patch changes the type of the xm-test initrd from ext2
to ext3 when needed.  It first checks, if ext2 support is missing and
ext3 support is available.  If so the fs type is changed to ext3.

Signed-off-by: Andreas Florath <xen@flonatel.org>
16 years agotools/tests/regression/: Fix some paths and scripts.
Keir Fraser [Sun, 2 Aug 2009 11:22:03 +0000 (12:22 +0100)]
tools/tests/regression/: Fix some paths and scripts.

o scripts and Makefile are mostly location independent now
  (exception XEN_ROOT in Makefile)
o use of $() instead of ${} in Makefile

From: Andreas Florath <xen@flonatel.org>
Signed-off-by: Keir Fraser <Keir.Fraser@eu.citrix.com>
16 years agoi386: fix full-value calculation of wrmsr handling for pv guests
Keir Fraser [Thu, 30 Jul 2009 16:56:23 +0000 (17:56 +0100)]
i386: fix full-value calculation of wrmsr handling for pv guests

The MSR value must be held in a 64-bit variable, not an unsigned long.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxm-test: Fix memset 01 and 02 tests: add support for sysfs memory interface
Keir Fraser [Wed, 29 Jul 2009 08:20:46 +0000 (09:20 +0100)]
xm-test: Fix memset 01 and 02 tests: add support for sysfs memory interface

From: Andreas Florath <xen@flonatel.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxend: pci: fix a typo in do_Dstate_transition
Keir Fraser [Wed, 29 Jul 2009 08:19:30 +0000 (09:19 +0100)]
xend: pci: fix a typo in do_Dstate_transition

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoxend: pass-through Use pci_dict_to_bdf_str() in hvm_pci_device_create()
Keir Fraser [Wed, 29 Jul 2009 08:19:13 +0000 (09:19 +0100)]
xend: pass-through Use pci_dict_to_bdf_str() in hvm_pci_device_create()

* Use pci_dict_to_bdf_str() in hvm_pci_device_create()
* Use pci_name instead of pci_str in error message, pci_str does not
* exist

Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agons16550: check_existence() can be marked __init
Keir Fraser [Tue, 28 Jul 2009 15:48:06 +0000 (16:48 +0100)]
ns16550: check_existence() can be marked __init

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agons16550: More robust check for presence of FIFO
Keir Fraser [Tue, 28 Jul 2009 15:47:37 +0000 (16:47 +0100)]
ns16550: More robust check for presence of FIFO

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoxend: make a crash dump directory per DomU
Keir Fraser [Tue, 28 Jul 2009 15:43:50 +0000 (16:43 +0100)]
xend: make a crash dump directory per DomU

Currently, xend dumps a core file of a DomU
in the directory "/var/xen/dump/", when the DomU has crashed.

The patch modifies this directory to "/var/xen/dump/<domain name>/".

It enables you to select HDD partition per DomU to dump core by using
mount command.

Signed-off-by: Rikiya Ayukawa <ayukawa.rikiya@jp.fujitsu.com>
16 years agoxend: pass-through: fix "xm pci-list-assignable-devices' for pv_guest
Keir Fraser [Tue, 28 Jul 2009 15:42:12 +0000 (16:42 +0100)]
xend: pass-through: fix "xm pci-list-assignable-devices' for pv_guest

xc.test_assign_device(dev) can only tell us if dev is assigned to hvm
guest; if a device is assigned to pv guest, xc.test_assign_device()
still tells us the device is not assigned yet, as a result, the device
still appears in the output of "xm pci-list-assignable-devices", and
xend would not prevent us from assigning the device to a new pv or hvm
guest.

To judge if a device has been assigned to guest, we have to scan
xenstore.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoxend: pass-through: fix pci passthrough for pv guest
Keir Fraser [Tue, 28 Jul 2009 15:41:13 +0000 (16:41 +0100)]
xend: pass-through: fix pci passthrough for pv guest

C/S 19754: a5f584c1e2f6 breaks pci passthrough for pv guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agox86,hvm: clean up vpt's period_cycles field
Keir Fraser [Tue, 28 Jul 2009 15:40:34 +0000 (16:40 +0100)]
x86,hvm: clean up vpt's period_cycles field

In struct periodic_time, pt->period_cycles is not cpu cycles since c/s
17716 and its value is always the same as pt->period.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
16 years agotools/tests: Add syntax check for different versions of python
Keir Fraser [Tue, 28 Jul 2009 15:38:08 +0000 (16:38 +0100)]
tools/tests: Add syntax check for different versions of python

From: Andreas Florath <xen@flonatel.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86: Initialize the ACPI "safe" power state to C1.
Keir Fraser [Tue, 28 Jul 2009 15:34:16 +0000 (16:34 +0100)]
x86: Initialize the ACPI "safe" power state to C1.

Initialize the ACPI "safe" power state to C1.  This avoids a null
dereference on BIOS tables which define C3 but not C2 or C1.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
16 years agoxend: fix migration hangs by closing fds on exec
Keir Fraser [Tue, 28 Jul 2009 15:33:46 +0000 (16:33 +0100)]
xend: fix migration hangs by closing fds on exec

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Reviewed-by: Xiaowei Hu <xiaowei.hu@oracle.com>
16 years agoxend: pass-through: device state in xenstore may be null
Keir Fraser [Tue, 28 Jul 2009 15:32:26 +0000 (16:32 +0100)]
xend: pass-through: device state in xenstore may be null

Signed-off-by: Tom Rotenberg <tom.rotenberg@gmail.com>
16 years agopassthrough: use tasklet to deliver interrupts
Keir Fraser [Tue, 28 Jul 2009 15:28:21 +0000 (16:28 +0100)]
passthrough: use tasklet to deliver interrupts

This patch enables delivery of interrupts even if the VCPU#0 is
halted.

Note: the changes to softirq.{ch} are needed for ia64 build.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
16 years agohvm vlapic: Fix vlapic_write() for partial register writes.
Keir Fraser [Tue, 28 Jul 2009 15:24:47 +0000 (16:24 +0100)]
hvm vlapic: Fix vlapic_write() for partial register writes.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxend: pass-through: Use parse_pci_name() in find_parent()
Keir Fraser [Tue, 28 Jul 2009 15:16:32 +0000 (16:16 +0100)]
xend: pass-through: Use parse_pci_name() in find_parent()

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agox86_32: handle x87 opcodes in TLS segment fixups
Keir Fraser [Tue, 28 Jul 2009 15:15:18 +0000 (16:15 +0100)]
x86_32: handle x87 opcodes in TLS segment fixups

This patch adds support to the TLS fixup code for x87 opcodes.  These
can be treated like 2-byte opcodes with a weird encoding.

The patch includes some extra changes because, now that we have >2
opcode tables and 9 different lead bytes in a two-byte opcode, a
simple boolean code will not be enough to differentiate one- and
two-byte opcodes.  Besides this, the patch is trivial since the
segment fixup code cares about the operands of the instruction, not
about its semantics.

From: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoRevert 19961: breaks xend start on some systems.
Keir Fraser [Fri, 24 Jul 2009 11:08:54 +0000 (12:08 +0100)]
Revert 19961: breaks xend start on some systems.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxend: Fix use of set() for Python 2.3.
Keir Fraser [Fri, 24 Jul 2009 09:39:43 +0000 (10:39 +0100)]
xend: Fix use of set() for Python 2.3.

From: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agohvmloader: Fix get_memsize() to cast high_mem_pgend to 64 bits.
Keir Fraser [Fri, 24 Jul 2009 09:37:52 +0000 (10:37 +0100)]
hvmloader: Fix get_memsize() to cast high_mem_pgend to 64 bits.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
16 years agopython: make tools/python/xen/util/fileuri.py work on python 2.3
Keir Fraser [Thu, 23 Jul 2009 08:01:30 +0000 (09:01 +0100)]
python: make tools/python/xen/util/fileuri.py work on python 2.3

@staticmethod syntax sugar was introduced at python2.4.
expand the syntax sugar for python 2.3

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
16 years agohoplugpath.sh: fix Makefile dependency.
Keir Fraser [Thu, 23 Jul 2009 08:00:55 +0000 (09:00 +0100)]
hoplugpath.sh: fix Makefile dependency.

In tools/hotplug/common/Makefile, install-scripts depends on genpath.
So add its dependency. Otherwise parallel build sometimes fails as
follows.

genpath and install-scripts command are being run simultaneously.
So When install-scripts tries to install it, it can be under creation.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
16 years agoxend: Don't call decode() if PV_{kernel,ramdisk} are ''
Keir Fraser [Thu, 23 Jul 2009 08:00:21 +0000 (09:00 +0100)]
xend: Don't call decode() if PV_{kernel,ramdisk} are ''

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agoxend: Set up CPUID leaves on restore for both PV and HVM guests.
Keir Fraser [Thu, 23 Jul 2009 07:59:03 +0000 (08:59 +0100)]
xend: Set up CPUID leaves on restore for both PV and HVM guests.

From: Andrew Thomas <andrew.thomas@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agofs-front: cope with a missing fs-backend
Keir Fraser [Thu, 23 Jul 2009 07:57:02 +0000 (08:57 +0100)]
fs-front: cope with a missing fs-backend

Obviously save\restore is not going to work if fs-backend is missing,
but at least the stubdom will be able to work correctly in all the
other cases.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agostubdom: update README as no reason to specify absolute paths
Keir Fraser [Thu, 23 Jul 2009 07:56:15 +0000 (08:56 +0100)]
stubdom: update README as no reason to specify absolute paths

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoRevert QEMU_TAG to 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f
Keir Fraser [Thu, 23 Jul 2009 07:53:00 +0000 (08:53 +0100)]
Revert QEMU_TAG to 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f

xenstore lowlevel function changes breaks stubdom build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agotools: xenbackendd for NetBSD
Keir Fraser [Wed, 22 Jul 2009 13:37:30 +0000 (14:37 +0100)]
tools: xenbackendd for NetBSD

Attached patch introduces xenbackendd. It is used on NetBSD
to launch the hotplug scripts. Later xenbackendd can be improved to
also launch qemu-dm as child process and will notice when qemu-dm
crashes.

The changes the patch makes:
- rename hotplug scripts as xenbackendd expects them
  (current names were taken from pkgsrc)
- install hotplug scripts as executable scripts
- introduce xenbackendd
- build/install/launch on NetBSD only

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agopage allocator: add mfn_valid() check to free_heap_pages() and scrub_pages()
Keir Fraser [Wed, 22 Jul 2009 13:06:21 +0000 (14:06 +0100)]
page allocator: add mfn_valid() check to free_heap_pages() and scrub_pages()

The changesets, 19913:ef38784f9f85 and 19914:d6c1d7992f43 eliminates
boot allocator bitmap which is also used for buddy allocator bitmap.
With those patches, xen/ia64 doesn't boot because page allocator
touches struct page_info which doesn't exist.
That happends because memory is populated sparsely on ia64
and struct page_info is so.

This patches fixes ia64 boot failure.
In fact, this is also a potential bug on x86. max_page seems
to be well aligned so that MAX_ORDER loop check prevented
to be bug appear.

- fix free_heap_pages().
  When merging chunks, buddy page_info() doesn't always exists.
  So check it by mfn_valid().

- fix scrub_pages()
  On ia64 page_info() is sparsely populated, so struct page_info
  doesn't always exist. Check it by mfn_valid()

- offline_pages(), online_pages() and query_page_offline()
  Also replace "< max_page" check with mfn_valid() for consistency.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
16 years agoxend: pass-through: use identity-mapping of PCI functions
Keir Fraser [Wed, 22 Jul 2009 13:05:26 +0000 (14:05 +0100)]
xend: pass-through: use identity-mapping of PCI functions

This reverses changeset "xend: pass-through: Implement least-mapping
of virtual" (19854:22067ba1de0d) and reverts the code to identity
mapping physical PCI functions to virtual ones when multi-function
virtual devices are in use. It is my opinion that this is both safer
and simpler than least-mapping, and that in the absence of further
analysis identity-mapping the best choice for now.

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agotools: implement balloon stat and cpuinfo for NetBSD
Keir Fraser [Wed, 22 Jul 2009 13:04:14 +0000 (14:04 +0100)]
tools: implement balloon stat and cpuinfo for NetBSD

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agox86 mce: Fix formatting in a couple of printks.
Keir Fraser [Wed, 22 Jul 2009 13:03:32 +0000 (14:03 +0100)]
x86 mce: Fix formatting in a couple of printks.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoUpdate QEMU_TAG to a42b67ed27a9744a2492c8ffe5c26935bd19ee27
Keir Fraser [Wed, 22 Jul 2009 13:02:36 +0000 (14:02 +0100)]
Update QEMU_TAG to a42b67ed27a9744a2492c8ffe5c26935bd19ee27

16 years agoxsm: Move ACM_DEBUG and printkd() out of public header. They are
Keir Fraser [Tue, 21 Jul 2009 14:47:41 +0000 (15:47 +0100)]
xsm: Move ACM_DEBUG and printkd() out of public header. They are
private to the ACM implementation within Xen.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoxsm: Do not use gcc-ism in public header file.
Keir Fraser [Tue, 21 Jul 2009 14:34:56 +0000 (15:34 +0100)]
xsm: Do not use gcc-ism in public header file.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoxend: pass-through: fix regression in the ordering of the output of xm pci list
Keir Fraser [Tue, 21 Jul 2009 13:26:52 +0000 (14:26 +0100)]
xend: pass-through: fix regression in the ordering of the output of xm pci list

changeset "python: Remove tab indents" (19937:e845326ae203)
introduces a minor regression in the multi-function PCI pass-through
code by causing bogus return values from the sort function
which is used to order the output of "xm pci list".

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agoRevert part of c/s 19349: fixes qcow for HVM guests
Keir Fraser [Tue, 21 Jul 2009 11:06:52 +0000 (12:06 +0100)]
Revert part of c/s 19349: fixes qcow for HVM guests

16 years agoRemove support for out-of-date SLES9 and RHEL4 kernel
Keir Fraser [Mon, 20 Jul 2009 14:51:14 +0000 (15:51 +0100)]
Remove support for out-of-date SLES9 and RHEL4 kernel
ports  from build integration

Both distros now include Xen support from their respective upstreams
and these kernels are very out of date wrt both the upstream distro
kernel and the upstream Xen kernel.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
16 years agolibxenguest: Revert domain builder interface changes for 'superpages'
Keir Fraser [Mon, 20 Jul 2009 14:45:50 +0000 (15:45 +0100)]
libxenguest: Revert domain builder interface changes for 'superpages'
parameter, and place the flag in a pad byte of 'struct xc_dom_image'
instead.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agolibxc: Use a single mmap interface to Linux
Keir Fraser [Mon, 20 Jul 2009 09:58:06 +0000 (10:58 +0100)]
libxc: Use a single mmap interface to Linux

Modify xc_map_foreign_range and xc_map_foreign_ranges to call
mmap_map_foreign_batch. This eliminates the need for multiple privcmd
mmap ioctls. Now only IOCTL_PRIVCMD_MMAPBATCH is required.

Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
16 years agoxend: Add support for URI ('file:' and 'data:' scheme) for PV/kernel and PV/ramdisk
Keir Fraser [Mon, 20 Jul 2009 09:12:38 +0000 (10:12 +0100)]
xend: Add support for URI ('file:' and 'data:' scheme) for PV/kernel and PV/ramdisk

Add support for 'file:' and 'data:' URI schemes for the parameters
'PV/kernel' and 'PV/ramdisk' in the VM.create() call.  The 'data:'
scheme handling enables using a file which is stored inside the
management system (from where the XenAPI call is send) as kernel or
ramdisk.

Notes:
o all included: a detailed description can be found in the xenapi
documentation
o bumped up the version of the API document to 1.0.8 (because of
(minimal) interface extension)
o Future enhancements (like http:, ftp: schemes) fit seamlessly into
the current design / classes

Signed-off-by: Andreas Florath <xen@flonatel.org>
16 years agox86: make show_page_walk() more robust
Keir Fraser [Mon, 20 Jul 2009 09:10:15 +0000 (10:10 +0100)]
x86: make show_page_walk() more robust

Also add in a missing line in x86-64's do_page_walk().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoxend: modify sort() for Python 2.3
Keir Fraser [Mon, 20 Jul 2009 09:09:00 +0000 (10:09 +0100)]
xend: modify sort() for Python 2.3

Python 2.3 does not support the sort(cmp, key, reverse) style.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoblktap2: Remove set() for Python 2.3
Keir Fraser [Mon, 20 Jul 2009 09:08:12 +0000 (10:08 +0100)]
blktap2: Remove set() for Python 2.3

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoia64: Define paging_mode_external(), now needed by grant_table.c
Keir Fraser [Mon, 20 Jul 2009 09:07:28 +0000 (10:07 +0100)]
ia64: Define paging_mode_external(), now needed by grant_table.c

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoUse git smart server protocol for qemu tree by default
Keir Fraser [Mon, 20 Jul 2009 09:02:50 +0000 (10:02 +0100)]
Use git smart server protocol for qemu tree by default

xenbits supports the git protocol now, which is much faster (and
produces less noise in the build log too).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoxend: Restore scheduling parameters
Keir Fraser [Thu, 16 Jul 2009 09:32:55 +0000 (10:32 +0100)]
xend: Restore scheduling parameters

Scheduling parameters are reset to default values when I restore
or migrate a domain.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
16 years agohvmloader: Add new test for MSR_SHADOW_GS_BASE validity after SWAPGS instruction.
Keir Fraser [Thu, 16 Jul 2009 09:30:50 +0000 (10:30 +0100)]
hvmloader: Add new test for MSR_SHADOW_GS_BASE validity after SWAPGS instruction.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agovmx: Fix handling of FS/GS base MSRs.
Keir Fraser [Thu, 16 Jul 2009 09:26:55 +0000 (10:26 +0100)]
vmx: Fix handling of FS/GS base MSRs.

Firstly, these MSRs are always accessible if the CPU supports them --
we should not check for EFER.LMA.

Secondly, we should not use teh cached value of shadow_gs while the
VCPU is running. It can be stale if the guest has executed SWAPGS
(which we cannot trap). Hence always access the underlying host MSR
when emulating guest accesses.

The latter bug was found and a patch proposed by <leonid@3tera.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agotmem: No noise when disabled and not configured
Keir Fraser [Thu, 16 Jul 2009 07:30:23 +0000 (08:30 +0100)]
tmem: No noise when disabled and not configured

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agox86 svm: Disable intercepting CR3 writes when nested paging is enabled
Keir Fraser [Thu, 16 Jul 2009 07:26:29 +0000 (08:26 +0100)]
x86 svm: Disable intercepting CR3 writes when nested paging is enabled

This patch disables intercepting CR3 writes when nested paging is
enabled. For applications which cause excessive CR3 accesses, the
patch can increase their performance.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
16 years agox86: extend some of Intel's recent MCE work to also support AMD
Keir Fraser [Wed, 15 Jul 2009 15:21:12 +0000 (16:21 +0100)]
x86: extend some of Intel's recent MCE work to also support AMD

At least the MSR handling for guests can easily be made shared between
the two vendors; likely a lot of the other code in mce_intel.c could
also be made common. The goal here, however, is to eliminate the
annoying guest-tried-to-modify-msr messages that result from enabling
the MCE code on the Linux side.

Additionally (in order for not having to make the same change twice to
basically identical code) the patch also merges
amd_{fam10,k8}_mcheck_init(), enables the former to also be used for
Fam11 (I'd suppose that Fam12 would also need to go here, but I have
no data to confirm that), and does some minor (mostly coding style for
the code moved around) adjustments.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agotools/check: We do need a default for ${PYTHON} as called from
Keir Fraser [Wed, 15 Jul 2009 14:33:05 +0000 (15:33 +0100)]
tools/check: We do need a default for ${PYTHON} as called from
install.sh with PYTHON possibly undefined in the environment.

So we make PYTHON=python the sensible default.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agotools/check: No need to check for ${PYTHON} existence.
Keir Fraser [Wed, 15 Jul 2009 13:53:01 +0000 (14:53 +0100)]
tools/check: No need to check for ${PYTHON} existence.

It must exist as otherwise the build will fail since we reference
$(PYTHON) all over the place. Furthermore the fallback of
'/usr/bin/env python' actually runs Python, it doesn't get the path to
it. So that wouldn't work very well.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoi386: eliminate unsupported CPUs' MCA handling code
Keir Fraser [Wed, 15 Jul 2009 13:35:34 +0000 (14:35 +0100)]
i386: eliminate unsupported CPUs' MCA handling code

Neither Intel P5 nor Winchip are supported by Xen (due to
-march=i686 being passed to the compiler), so there is no point in
having code for handling their (rudimentary) MCA capabilities.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoRename for_each_cpu() to for_each_possible_cpu()
Keir Fraser [Wed, 15 Jul 2009 12:15:50 +0000 (13:15 +0100)]
Rename for_each_cpu() to for_each_possible_cpu()

... to be more precise in naming, and also to match Linux.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoi386: fix handling of Xen entries in final L2 page table
Keir Fraser [Wed, 15 Jul 2009 12:07:30 +0000 (13:07 +0100)]
i386: fix handling of Xen entries in final L2 page table

Running Xen on top of KVM exposed an issue that latently also exists
on real hardware: So far, updating any L3 entry resulted in the Xen
owned part of the L2 table referenced by the final L3 one to be re-
initialized. This was not only unnecessary, it actually resulted in
Xen relying on the TLB entry which maps the L2 page that's being
updated not going away intermediately, since as a first step the full
range of Xen owned entries in the L2 were replaced by the respective
ones from the idle page table, and only then the per-domain entries
got re- written to their intended values.

This part of the initialization really is sufficient to be done once,
when the page becomes an L2-with-Xen-entries (PGT_pae_xen_l2) one,
i.e. can be moved to alloc_l2_table(). Only the linear page table
setup has to remain where it always was.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agostubdom: make -> $(MAKE)
Keir Fraser [Wed, 15 Jul 2009 09:31:50 +0000 (10:31 +0100)]
stubdom: make -> $(MAKE)

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoFix a couple of comment typos.
Keir Fraser [Wed, 15 Jul 2009 09:30:59 +0000 (10:30 +0100)]
Fix a couple of comment typos.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agox86: Fix an oversight of c/s 19927 - per-CPU data accesses must
Keir Fraser [Wed, 15 Jul 2009 08:14:19 +0000 (09:14 +0100)]
x86: Fix an oversight of c/s 19927 - per-CPU data accesses must
not be iterated over using NR_CPUS bound loops.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agostubdom: don't leak include dir on distclean
Keir Fraser [Wed, 15 Jul 2009 08:11:40 +0000 (09:11 +0100)]
stubdom: don't leak include dir on distclean

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agominios: switch to C99 integer types
Keir Fraser [Wed, 15 Jul 2009 08:09:48 +0000 (09:09 +0100)]
minios: switch to C99 integer types

This is a necessary step to make minios build on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agodebug=y default during development
Keir Fraser [Tue, 14 Jul 2009 20:25:24 +0000 (21:25 +0100)]
debug=y default during development
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agostubdom: fix stubdom-dm error path
Keir Fraser [Tue, 14 Jul 2009 13:46:04 +0000 (14:46 +0100)]
stubdom: fix stubdom-dm error path

Exit the shell and not a subshell.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agopython: Remove tab indents.
Keir Fraser [Tue, 14 Jul 2009 13:43:19 +0000 (14:43 +0100)]
python: Remove tab indents.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agopass-through: use vdevn in xm_pci_attach()
Keir Fraser [Tue, 14 Jul 2009 13:38:56 +0000 (14:38 +0100)]
pass-through: use vdevn in xm_pci_attach()

Use vdevfn in xm_pci_attach() for non-zero functions,
the vslot element of dev dictionaries no longer exists.

Signed-off-by: Simon Horman <horms@verge.net.au>
16 years agodocs/xenapi: Update examples section reflecting the current behaviour.
Keir Fraser [Tue, 14 Jul 2009 13:37:53 +0000 (14:37 +0100)]
docs/xenapi: Update examples section reflecting the current behaviour.

Signed-off-by: Andreas Florath <xen@flonatel.org>
16 years agostubdom: Install and use stubdompath.sh
Keir Fraser [Mon, 13 Jul 2009 15:50:53 +0000 (16:50 +0100)]
stubdom: Install and use stubdompath.sh
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agox86-64: reduce symbol table size
Keir Fraser [Mon, 13 Jul 2009 15:49:50 +0000 (16:49 +0100)]
x86-64: reduce symbol table size

With all of Xen's symbols sitting within a 2Gb range on x86-64, they
can be referred to by the kallsyms-like offset table using 4- instead
of 8-byte slots.

The marker table can use 4-byte slots in all cases, just like the
table entry counts can (though that's only a minor improvement).

If ia64's PERCPU_ADDR got moved down to (KERNEL_START + 2Gb -
PERCPU_PAGE_SIZE), it could also utilize the more compact form.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoMapping grant references into HVM guests, take 2
Keir Fraser [Mon, 13 Jul 2009 11:35:34 +0000 (12:35 +0100)]
Mapping grant references into HVM guests, take 2

After some discussion, here's a second version of the patch I posted a
couple of weeks back to map grant references into HVM guests.  As
before, this is done by modifying the P2M map, but this time there's
no new hypercall to do it.  Instead, the existing GNTTABOP_map is
overloaded to perform a P2M mapping if called from a shadow mode
translate guest.  This matches the IA64 API.

Signed-off-by: Steven Smith <steven.smith@citrix.com>
Acked-by: Tim Deegan <tim.deegan@citrix.com>
CC: Bhaskar Jayaraman <Bhaskar.Jayaraman@lsi.com>
16 years agoEliminate grant_table_op restriction
Keir Fraser [Mon, 13 Jul 2009 11:18:04 +0000 (12:18 +0100)]
Eliminate grant_table_op restriction

Eliminate the hard-coded, arbitrarily chosen limit of 512 grant table
ops a domain may submit at a time, and instead check for necessary
preemption after each individual element got processed, invoking the
hypercall continuation logic when necessary.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoAllow XENMEM_exchange to support exchange on foreign domains.
Keir Fraser [Mon, 13 Jul 2009 11:17:05 +0000 (12:17 +0100)]
Allow XENMEM_exchange to support exchange on foreign domains.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
16 years agoVT-d: fix assertion fault in pci passthrough code
Keir Fraser [Mon, 13 Jul 2009 10:52:49 +0000 (11:52 +0100)]
VT-d: fix assertion fault in pci passthrough code

Remove ASSERT(spin_is_locked(&pcidevs_lock)) in
pci_get_pdev_by_domain() to allow caller the flexibility to not hold
the lock if it does not care if the device is hot removed between the
time it got the pdev and the time it is used to get the corresponding
vt-d engine.  In the new RHSA use case, we just wanted to get the vt-d
engine of any device passthrough in the domain. Also, rename RHSA
field "domain" to "proximity domain" to avoid overloading the term
"domain" in virtualization context.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
16 years agox86: merge final linking scripts
Keir Fraser [Mon, 13 Jul 2009 10:51:07 +0000 (11:51 +0100)]
x86: merge final linking scripts

While unrelated to the previous four patches, I realized that the two
scripts are nearly identical when coding those earlier patches, and
this patch depends on them in order to apply cleanly.

As an extra measure, it also adjusts the (unused) space freed at the
end of the per-CPU area to include all alignment space needed before
the first actual constituent of the .bss section (up to 7 pages on
x86-64).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoMove cpu_{sibling,core}_map into per-CPU space
Keir Fraser [Mon, 13 Jul 2009 10:45:31 +0000 (11:45 +0100)]
Move cpu_{sibling,core}_map into per-CPU space

These cpu maps get read from all CPUs, so apart from addressing the
square(nr_cpus) growth of these objects, they also get moved into the
previously introduced read-mostly sub-section of the per-CPU section,
in order to not need to waste a full cacheline in order to align (and
properly pad) them, which would be undue overhead on systems with low
NR_CPUS.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoIntroduce and use a per-CPU read-mostly sub-section
Keir Fraser [Mon, 13 Jul 2009 10:32:41 +0000 (11:32 +0100)]
Introduce and use a per-CPU read-mostly sub-section

Since mixing data that only gets setup once and then (perhaps
frequently) gets read by remote CPUs with data that the local CPU may
modify (again, perhaps frequently) still causes undesirable cache
protocol related bus traffic, separate the former class of objects
from the latter.

These objects converted here are just picked based on their write-once
(or write-very-rarely) properties; perhaps some more adjustments may
be desirable subsequently. The primary users of the new sub-section
will result from the next patch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86: move ucode_cpu_info into per-CPU space
Keir Fraser [Mon, 13 Jul 2009 10:31:34 +0000 (11:31 +0100)]
x86: move ucode_cpu_info into per-CPU space

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agox86: move init_tss into per-CPU space
Keir Fraser [Mon, 13 Jul 2009 10:31:08 +0000 (11:31 +0100)]
x86: move init_tss into per-CPU space

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoia64: consolidate final linking step
Keir Fraser [Mon, 13 Jul 2009 10:19:31 +0000 (11:19 +0100)]
ia64: consolidate final linking step

This basically makes the final linking stage identical to x86's (with
the sole difference being that ia64 has the linker generate a map
file, while x86 doesn't), so would generally allow moving the final
linking rule into xen/Rules.mk.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agoi386: fix boot
Keir Fraser [Mon, 13 Jul 2009 10:18:57 +0000 (11:18 +0100)]
i386: fix boot

Since the Xen heap pages (which are the only ones mapped at this
point) don't get passed to init_boot_pages(), it has no place to store
the bootmem regions without faulting. Hence, a mapped page must be
passed to that function as the very first thing.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
16 years agostubdom: Fix stubdom-dm after c/s 19818
Keir Fraser [Fri, 10 Jul 2009 17:12:13 +0000 (18:12 +0100)]
stubdom: Fix stubdom-dm after c/s 19818

19818 added the following line to stubdom-dm:
  . ./stubdompath.sh
and replaced many paths with variables.  However the path to
stubdompath.sh is obviously wrong and stubdompath.sh is nowhere to be
found anyway.  For the moment I am dropping . ./stubdompath.sh and
hardcoding the values of the variables.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agonetbsd: remove qemu-ifup-nbsd, now that it is in the right place
Keir Fraser [Thu, 9 Jul 2009 16:06:40 +0000 (17:06 +0100)]
netbsd: remove qemu-ifup-nbsd, now that it is in the right place
(ioemu c/s 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f)

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoMake python check scripts use of $(PYTHON) make variable.
Keir Fraser [Thu, 9 Jul 2009 16:05:07 +0000 (17:05 +0100)]
Make python check scripts use of $(PYTHON) make variable.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agotools: python -> $(PYTHON)
Keir Fraser [Thu, 9 Jul 2009 15:06:52 +0000 (16:06 +0100)]
tools: python -> $(PYTHON)
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agoUpdate QEMU_TAG to 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f
Keir Fraser [Thu, 9 Jul 2009 15:06:01 +0000 (16:06 +0100)]
Update QEMU_TAG to 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f

16 years agoUse $(PYTHON) Makefile variable when building the hypervisor.
Keir Fraser [Thu, 9 Jul 2009 14:26:24 +0000 (15:26 +0100)]
Use $(PYTHON) Makefile variable when building the hypervisor.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
16 years agox86_64: Fix Xen relocation size -- there is no longer an allocation
Keir Fraser [Thu, 9 Jul 2009 07:52:31 +0000 (08:52 +0100)]
x86_64: Fix Xen relocation size -- there is no longer an allocation
bitmap to account for.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoReplace boot-time free-pages bitmap with a region list.
Keir Fraser [Wed, 8 Jul 2009 21:08:31 +0000 (22:08 +0100)]
Replace boot-time free-pages bitmap with a region list.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agoDo not use bitmap allocator after boot time.
Keir Fraser [Wed, 8 Jul 2009 15:47:58 +0000 (16:47 +0100)]
Do not use bitmap allocator after boot time.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>